#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+1000;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL tree[maxn][2],a[maxn],prea[maxn],preb[maxn],pt=0;
void ins(LL val){
     LL cur=0;
     for(LL i=31;i>=0;i--){
         LL c=(val>>i)&1;
         if(!tree[cur][c]) tree[cur][c]=++pt;
         cur=tree[cur][c];
     }
}
LL query(LL val){
    LL res=0;LL cur=0;
    for(LL i=31;i>=0;i--){
        LL c=(val>>i)&1;
        if(tree[cur][1^c]) {
            res+=1LL<<i;
            cur=tree[cur][1^c];
        }
        else{
            res+=0;
            cur=tree[cur][c];
        }
    }
    return res;
}
int main(void){
   	cin.tie(0);std::ios::sync_with_stdio(false);
    LL n;cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=n;i++){
        prea[i]=prea[i-1]^a[i];
        preb[i]=preb[i-1]^(a[i]+1);
    }
    LL ans=0;
    for(int i=1;i<=n;i++){
        LL x=(prea[n]^prea[i])^preb[i];
        ins(x);
    }
    for(int i=1;i<=n;i++){
        ans=max(ans,query(prea[i]^preb[i]));
    }
    cout<<ans<<endl;
   	return 0;
}
